'''
Created on 11/05/2012

@author: nicolas
'''

import pylab as p

Ts = [0.002, 0.004, 0.01]       #Tiempo de muestreo
Fs = [1.0 / t for t in Ts]      #intervalo de muestreo
NFFT = [512, 256, 32]                      #largo de ventana
noverlap = 16

#defino el tiempo de muestreo
t_array = [p.arange(0, 100, time) for time in Ts]

#defino la funcion
def x(t):
    return p.cos(2 * p.pi * (t ** 2))

#Muestreo
muestreo = [x(t) for t in t_array]

# Grafico
for i in range(len(Ts)):
    p.figure(i)
    p.title('Ts='+str(Ts[i]))
    p.specgram(muestreo[i], NFFT=NFFT[i], Fs=Fs[i], noverlap=noverlap)
    p.savefig('punto_2_Ts_'+str(Ts[i])+'.png')

p.show()